﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using DAL;

public partial class MasterPage_Home : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["thanhvienObject"] != null)
        {
            THANHVIEN tv = (THANHVIEN)Session["thanhvienObject"];
            label_name_visitor.Text = tv.tenthanhvien;
        }
        else {
            Response.Redirect("LogIn.aspx");    
        }
    }
    protected void LinkButton4_Click(object sender, EventArgs e)
    {
        THANHVIEN tv = (THANHVIEN)Session["thanhvienObject"];
        OnlineActiveUsers.OnlineUsersInstance.OnlineUsers.SetUserOffline(tv.mathanhvien.ToString());

        Session.Clear();
        Response.Redirect("LogIn.aspx");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        switch (Session["Tenvaitro"].ToString())
        {
           case "Quản trị":
                Response.Redirect("Hoso/HosoQuantri.aspx");
                break;
           case "Bác sĩ":
                Response.Redirect("Hoso/HosoBacsi.aspx");
                break;
           case "Khách":
                Response.Redirect("Hoso/HosoKhach.aspx");
                break;
        }
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {

    }
    protected void LinkButton3_Click(object sender, EventArgs e)
    {
        Response.Redirect("Timkiem.aspx");
    }
    protected void LinkButton5_Click(object sender, EventArgs e)
    {

    }
    protected void btn_Click(object sender, EventArgs e)
    {
        Response.Redirect("Home.aspx");
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {

    }
}
